﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sexybeauty.Core.Inf.Entities.Table;

namespace Sexybeauty.Core.Inf.LogicEntity
{
    public class ShortMessageEntity : IAccessible<ShortMessage,ShortMessageEntity>
    {
        #region Fileds
        public int Id { get; set; }
        /// <summary>
        /// 可以匿名
        /// </summary>
        public string From { get; set; }
        public string To { get; set; }
        public string Message { get; set; }
        public DateTime RcdDate { get; set; }
        public bool IsRead { get; set; }
        #endregion

        protected override void Covariant(ShortMessage dbModel)
        {
            this.Id = dbModel.Id;
            this.From = dbModel.From;
            this.To = dbModel.To;
            this.Message = dbModel.Message;
            this.RcdDate = dbModel.RcdDate;
            this.IsRead = dbModel.IsRead;
        }
        protected override ShortMessage Inverter(ShortMessageEntity model)
        {
            return new ShortMessage()
            {
                From = model.From,
                Id = model.Id,
                IsRead = model.IsRead,
                Message = model.Message,
                RcdDate = model.RcdDate,
                To = model.To
            };
        }
    }
}
